
import configs from '../src/config';
import Mock from "mockjs";

const { mockAPIPrefix } = configs;

let worknoticeListData = Mock.mock({
  'data|80-100': [
    {
      id: '@id',
      content: '@cname',
      status: `已通过`,
      time: '@datetime',
    },
  ],
});
let worknotice = worknoticeListData.data;
export default {

  [`GET ${mockAPIPrefix}/worknotice/list`] (req, res){

    let { pageSize, page, ...otherArgs } = req.query;
    pageSize = pageSize || 10;
    page = page || 1;
    let data = worknotice.slice((page - 1) * pageSize, page * pageSize);
    setTimeout(() => {
      res.json({
        success: true,
        data: {
          list: data,
          total: worknotice.length,
        },
      });
    }, 2000);
  },


};

